home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 22
/
Cream of the Crop 22.iso
/
utility
/
dirco609.zip
/
DIRCOMP.DOC
< prev
next >
Wrap
Text File
|
1996-09-16
|
13KB
|
276 lines
DIRCOMP.DOC 1 Revised: 09-16-96
DIRCOMP compares subdirectories and looks for dissimilarities between files
(different sizes or creation dates as well as missing files). You can have the
command copy files from the first subdirectory to the output subdirectory. In
some ways, this is similar to the XCOPY and REPLACE commands in DOS except there
are a number of enhancements which make DIRCOMP ideal for network maintenance
work. These features include:
* You can specify that the command copy only unmatched files (something
that can't be done using XCOPY).
* You can specify that the command process child subdirectories as well
(something that can't be done using REPLACE).
* You can delete the files which are in the destination subdirectory but
not in the source subdirectory.
* You can specify up to 10 file exclusion or file inclusion specifications.
* DIRCOMP produces a disk report called (by default) C:\DIRCOMP.TXT showing
the dissimilarities.
* DIRCOMP can move the files instead of copy them, effectively allowing you
to prune and graft directory structures.
* The date format shown is based on your country setting.
To reduce the risks inherent in this sort of automatic execution, neither
/UPDATE or /KILL are available if the secondary subdirectory is a network drive
unless the "/NET" option is passed in.
DIRCOMP is typically used in the process of backing up files from one drive to
another. DIRCOMP allows you to easily copy every file and get rid of now
non-existant files.
Most people who report using DIRCOMP say they use the program to maintain
workstations in a networked environment. They take the files from a network
directory and use them to replace the files on the workstation.
Note that DOS includes a command called REPLACE which will do some of the same
things that this utility does. The central differences are that REPLACE won't
delete mismatched files and it doesn't produce a report on inconsistencies.
REPLACE also doesn't have the ability to handle odd attributes or deal with
cascading subdirectories. REPLACE *is* a lot quicker though.
WIN95 AND WINNT NOTICE: As with most DOS-based utilities, this program doesn't
understand the weird subdirectories, long filenames, invalid characters that are
possible under Windows 95 and Windows/NT. If you're in non-compatible file
mode, the program may not work correctly.
DIRCOMP.DOC 2 Revised: 09-16-96
Specifying parameters:
Parameters for this program can be set in the following ways. The last setting
encountered always wins:
- Read from an *.INI file (see BRUCEINI.DOC file),
- Through the use of an environmental variable (SET DIRCOMP=whatever), or
- From the command line (see "Syntax" below)
Syntax:
DIRCOMP directory1 directory2 [ /S ] [ /CREATE ] [ /Xfilespec ]...
[ /Nfilespec ]... [ /UPDATE ] [ /KILL ] [ /-A ] [ /-U ]
[ /CLONE ] [ /MOVE ] [ /ATTR=[H][S][R] ] [ /NET ]
[ /F | /Frptfile | /-F ] [ /OVERWRITE | /APPEND | /-OVERWRITE | /OVERASK ]
[ /ALL ] [ /Tpath ] [ /COLOR=nnn | /MONO ] [ /Q ]
[ /Iinitfile | /-I ] [ /? ]
where:
"directory1" is the name of the primary (source) subdirectory. If /UPDATE is
used, the secondary subdirectory's contents will be changed to reflect the ones
here.
"directory2" is the name of the secondary subdirectory which will have files
copied to it or deleted from it.
"/S" goes through and processes subdirectories off of the subdirectories you
specified in a cascading manner. You can use this option to copy entire
directory trees if you want. Still requires /UPDATE if you want it to actually
do anything besides report on conditions of course. The program may not be
smart enough to delete all embedded subdirectories. "/-S" (the opposite) is
initially the default.
"/CREATE" will create directory2 if it doesn't exist already. "/-CREATE" (the
opposite) is initially the default.
"/Xfilespec" says to exclude certain filespecs from being considered.. You can
specify up to 10 exclusion parameters but each must have their own /Xfilespec
statement. For example, to exclude all files with a CFG extension, you could
say "DIRCOMP (other parms) /X*.CFG".
"/Nfilespec" says to include certain filespecs. You can specify up to 10
inclusion parameters but each must have their own /Nfilespec statement. Files
have to meet this filespec filter in order to be considered. For example, to
only update EXE and COM files, you could say "DIRCOMP (other parms) /I*.EXE
/I*.COM".
"/UPDATE" says to copy any files from directory1 to directory2 which are either
(a) newer in directory1 (unless /-U specified) or (b) not in directory2 at all
(unless /-A specified). Unless /CLONE is specified, files will *NOT* be copied
if (a) the directory2 files are more recent or (b) file sizes are the only
difference. "/-UPDATE" (the opposite) is initially the default.
DIRCOMP.DOC 3 Revised: 09-16-96
"/KILL" says to delete any files in directory2 which are not in directory1. It
will also delete any empty subdirectories in directory2 (whether they were empty
off directory1 or not). /KILL automatically invokes /UPDATE. "/-KILL" (the
opposite) is initially the default.
"/-A" says to copy files only if they are already in the output directory. This
is the opposite of the /A (add) function which is initially the default. "/-A"
used in combination with "/-U" would exclude all files from consideration and is
not allowed.
"/A" copies files even if they do not exist already in the output directory.
Unlike with DOS's REPLACE command, "/A" and "/U" are not mutually exclusive.
"/A" is initially the default.
"/-U" says to copy files only if they do not exist already in the output
directory. This is the opposite of the /U (update) function which is initially
the default. "/-U" used in combination with "/-A" would exclude all files from
consideration and is not allowed.
"/U" copies files even if they already exist in the output directory. Unless
/CLONE is specified, only files which are newer in the source subdirectory will
be copied. Unlike with DOS's REPLACE command, "/A" and "/U" are not mutually
exclusive. "/U" is initially the default.
"/CLONE" says to copy all files from directory1 to directory2 even if the files
in directory2 are more recent than those in directory1. /CLONE automatically
invokes /UPDATE. "/-CLONE" (the opposite) is initially the default.
"/MOVE" says to move the files instead of copying them. This deletes from
directory1 any file that was copied to directory2. (The deletion is done only
if the initial copy succeeded.) Typically, the option is used in combination
with the /CLONE option. Since this option is kind of scarey if used
incorrectly, you have to specify /UPDATE as well in order to use it. "/-MOVE"
(the opposite) is initially the default.
"/ATTR=[H][S][R]" allows you to specify a combination of attributes that you
want considered. Normally, hidden, system, and read-only files are ignored by
the routine. Using /ATTR, you can include whatever you want. /ATTR=HSR, for
example, gets them all.
"/NET" removes a restriction which does not allow the secondary directory to be
a network drive. Note that the test the program performs for this is somewhat
imperfect and it may not notice that it's actually a networked drive. Sorry!
"/-NET" (the opposite) is initially the default.
"/F" says to create a report file named C:\DIRCOMP.TXT which shows what action
was taken. "/F" is, in fact, the same as entering "/FC:\DIRCOMP.TXT". The
default is initially to create no report at all ("/-F").
"/Frptfile" provides the name of the report file to create. Specifying
"/FSCRN:" will send the report to the screen. The default is initially to
create no report at all ("/-F").
"/-F" skips the creation of the report file. This is initially the default.
DIRCOMP.DOC 4 Revised: 09-16-96
"/OVERWRITE" says to overwrite the report file if it's already there.
"/APPEND" says to append to the end of any existing report file.
"/-OVERWRITE" says to abort if the output file exists already.
"/OVERASK" says to prompt if the output file exists already. This is the
default.
"/ALL" says to write all files to the report file (typically C:\DIRCOMP.TXT),
not just the ones that have differences. "/-ALL" (the opposite) is initially
the default.
"/Tpath" specifies where to write the temporary ISAM files that the routine
needs. ISAM data bases are used to store and sort the file names. ISAM files
cannot be created reliably on certain types of drives. Examples are "/TC:" and
"/TC:\TEMP". If not specified, the routine writes to the following in sequence:
- the value of any TEMP, then TMP, environmental variable
- C:\TEMP
- C:\
"/COLOR=nnn" specifies the default color settings to use. The setting must must
consist of three digits, the first two being the foreground color and the last
being the background color. The foreground color should be padded on the left
with a 0 if it is only one digit in length. Defaults to "COLOR=071" (white on
blue).
Foreground colors:
Low intensity High intensity
0 = black 8 = dark grey
1 = blue 9 = light blue
2 = green 10 = light green
3 = cyan 11 = light cyan
4 = red 12 = light red
5 = magenta 13 = light magenta
6 = brown 14 = light yellow
7 = white 15 = bright white
Adding 16 to any color will make the text blink. Background colors can consist
of 0 to 7 above. Bright white on blue, for example, would be "151". Note that
the program automatically adds 8 to the settings periodically for emphasis so
setting the default color to be high intensity will actually make the
deliberately highlighted text blink. Very few sane people actually like
blinking text so using foreground colors above 7 is not recommended.
"/MONO" (or "/-COLOR") turns off the colors. Same thing as "/COLOR=070".
"/Q" turns off the file-by-file status messages. It also turns off a detailed
summary table that shows up after the program is finished.
DIRCOMP.DOC 5 Revised: 09-16-96
"/Iinitfile" says to read an initialization file with the file name "initfile".
The file specification *must* contain a period. Initfiles are described in the
BRUCEINI.DOC file. Initially defaults to "/IDIRCOMP.INI".
"/-I" (or "/INULL") says to skip loading the initialization file.
"/?" or "/HELP" or "HELP" shows you the syntax for the command.
Samples: DIRCOMP J:\EBBNEW\DATA E:\EBBNEW\DATA /KILL /FC:\DATA.EBB
DIRCOMP E:\EBBNEW\DATA J:\EBBNEW\DATA /UPDATE /KILL /NET
DIRCOMP C:\TC D:\TEMP /UPDATE /KILL /ATTR=RHS /S
Return codes:
DIRCOMP returns the following ERRORLEVEL codes:
0 = no problems
249 = /UPDATE but none copied/moved/deleted
250 = operation aborted by pressing Escape
251 = other problems
253 = no files found in subdirectories
254 = could not find a decent temporary output subdirectory
255 = syntax problems, or /? requested
Author:
This program was written by Bruce Guthrie of Wayne Software. It is free for use
and redistribution provided relevant documentation is kept with the program, no
changes are made to the program or documentation, and it is not bundled with
commercial programs or charged for separately. People who need to bundle it in
for-sale packages must pay a $50 registration fee to "Wayne Software" at the
following address.
Additional information about this and other Wayne Software programs can be found
in the file BRUCEymm.DOC which should be included in the original ZIP file.
("ymm" is replaced by the last digit of the year and the two digit month of the
release. BRUCE512.DOC came out in December 1995. This same naming convention
is used in naming the ZIP file that this program was included in.) Comments and
suggestions can also be sent to:
Bruce Guthrie
Wayne Software
113 Sheffield St.
Silver Spring, MD 20910
fax: (301) 588-8986
e-mail: bguthrie@nmaa.org
http://hjs.geol.uib.no/guthrie/
See BRUCEymm.DOC file for revision history.
Please provide an Internet e-mail address on all correspondence.